#ifndef __FIXEDQUEUE_H__
#define __FIXEDQUEUE_H__

#include <sem.h>

typedef struct {
	int max;
	int read;
	int write;
	int status;
	int pop_size;
	int push_size;
	sem_t sem_push;
	sem_t sem_pop;
	char * data;
} fqueue;

void
fixedqueue_init( fqueue * q, int max, char * buffer );

int
fixedqueue_push( fqueue * q, char c );

int
fixedqueue_pop( fqueue * q, char * c );

int
fixedqueue_waitpop( fqueue * q, int s, char * c );

int
fixedqueue_waitpush( fqueue * q, int s, const char * c );

int
fixedqueue_nowaitpop( fqueue * q, int s, char * c );

int
fixedqueue_nowaitpush( fqueue * q, int s, char * c );

int
fixedqueue_size( fqueue * q);
#endif
